from talkToGoogle import *

x = talkToGoogle()

x.authenticate('user4','pass4')

#x.addEvent(x.user_name,
#timeToString(datetime.datetime(2009,4,21,8,0,0),4),
#timeToString(datetime.datetime(2009,4,22,0,0,0),4)
#)

#x.removeRangeEvents(x.user_name,
#timeToString(datetime.datetime(2009,4,23,13,0,0),4),
#timeToString(datetime.datetime(2009,4,25,10,0,0),4)
#)

#x.addWeeklyEvent(x.user_name, timeToString(datetime.datetime(2009,4,25,16,0,0),4), timeToString(datetime.datetime(2009,4,25,20,0,0),4), 'always working here')

#x.removeRangeEvents(x.user_name,
#timeToString(datetime.datetime(2009,6,1,12,0,0),4),
#timeToString(datetime.datetime(2009,6,15,12,0,0),4)
#)


#print '$$', x.removeEvent(x.user_name,timeToString(datetime.datetime(2009,5,16,16,0,0),4), timeToString(datetime.datetime(2009,5,16,20,0,0),4)),'$$'
#def acquireEmployeeEvents(self,current_user_name, additional_query='',start_time = str(time.localtime()[0]-1)+'-01-01', stop_time =  str(time.localtime()[0]+1)+'-12-31'):
temp = x.acquireEmployeeEvents(x.user_name, 'available',timeToString(datetime.datetime(2009,4,21,12,0,0),4), timeToString(datetime.datetime(2009,4,26,12,0,0),4))

print len(temp)

for i in temp:
	for j in i:
		print j
	print '\n\n'
